﻿using NTypeClasses;

namespace TypeClassSample.Math
{
	[TypeClass]
	public abstract class Ring<T>
	{
		public abstract T op_Addition(T a, T b);
		public virtual T op_Subtraction(T a, T b)
		{
			return op_Addition(a, op_UnaryNegation(b));
		}
		public abstract T op_Multiply(T a, T b);
		public abstract T Zero { get; }
		public abstract T op_UnaryNegation(T value);
		public virtual T op_UnaryPlus(T value)
		{
			return value;
		}
		public abstract bool op_Equality(T a, T b);
		public virtual bool op_Inequality(T a, T b)
		{
			return !op_Equality(a, b);
		}
	}
}
